//
//  NewDIYController.m
//  BigJoy
//
//  Created by Rowling on 2017/6/30.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "NewDIYController.h"
#import "NewDIYViewModel.h"
#import "DIYListVC.h"

@interface NewDIYController ()
@property (nonatomic,strong)NewDIYViewModel * viewModel;
@end

@implementation NewDIYController

-(NewDIYViewModel *)viewModel {
    if (_viewModel == nil) {
        _viewModel = [[NewDIYViewModel alloc]init];
        @weakify(self);
        [_viewModel.subject subscribeNext:^(id  _Nullable x) {
            if ([x isEqualToString:@"push"
                ]) {
                @strongify(self);
                DIYListVC * vc = [DIYListVC new];
                [self.navigationController pushViewController:vc animated:YES];
            }
        }];
    }
    return _viewModel;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"定制";
//    self.automaticallyAdjustsScrollViewInsets = NO;
    [self.viewModel bindViewModel:self.view];
}





@end
